package datasv.login_datasv;

import data.datafactory.DatabaseOperator;
import po.UserPO;

public class FindUser {
	public static void main(String[] args) {
		System.out.println(new FindUser().findUser("001131001"));
	}
	public UserPO findUser(String id){
		return findInSql(id);
	}
	private UserPO findInSql(String id){
		DatabaseOperator op=new DatabaseOperator("university_database");
		if(!op.ifIDExist("userpo_list", id)){
			return null;
		}
		String ID,pw;
		ID=op.getOneInform(id, "userpo_list", "id");
		pw=op.getOneInform(id, "userpo_list", "password");
		if(ID==null||pw==null){
			return null;
		}
		return new UserPO(ID, pw);
	}
}
